import { requestToData } from '@/api/commonHttp';

// 售价管理 - 修改价格组 - 设置价格组列表查询
export const getInitByProductUuidsService = (data, target) => requestToData({
  url: '/sysback/salepricegrouptempbatchup/getInitByProductUuids',
  type: 'post',
  data,
  target
});

// 售价管理 - 修改价格组 - 查询设置列表
export const getNewByProductUuidsService = (params, target) => requestToData({
  url: `/sysback/salepricegrouptempbatchup/getNewByProductUuids?uuid=${params.uuid}`,
  type: 'post',
  data: params.data,
  target
});

// 售价管理 - 修改价格组 - 查询设置后的价格组列表
export const getSetGroupListService = (data, target) => requestToData({
  url: `/sysback/salepricegrouptempbatchup/getContainCoverageByOper?uuid=${data.uuid}`,
  type: 'post',
  target
});

// 售价管理 - 修改价格组 - 提交售价信息
export const submitPriceRelativeInfoService = (params, loadingFn) => requestToData({
  url: `/sysback/salepricegrouptempbatchup/createComplateSaleSku?areaType=1&uuid=${params.uuid}`,
  type: 'post',
  data: params.data,
  loadingFn
});

// 售价管理 - 修改价格组 - 提交售价信息校验
export const validatePriceRelativeInfoService = (params, loadingFn) => requestToData({
  url: `/sysback/saleprice/validateUpdateSalePriceGroup?uuid=${params.uuid}`,
  type: 'post',
  data: params.data,
  loadingFn
});
